<?php

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class GridPrice extends Model
{
    use SoftDeletes;

    protected $table = 'grid_price';

    protected $fillable = [
        'grid_id',
        'street_id',
        'village_id',
        'project_id',
        'segment_id',
        'type',
        'subsidy_fee',
        'transition_fee',
        'require_sign_fee',
        'require_clear_fee',
        'if_decorate_fee',
        'other_subsidy_fee',
        'supply_total_fee',
        'house_difference_fee',
        'party_a_fee',
        'party_b_fee',
        'pay_fee',
        'pay_time',
        'num',
        'imgs',
        'do_user_id',
        'stop_fee',
        'lack_area_fee',
        'money_fee',
        'yard_fee',
        'othe_build_fee',
        'assess_fee',
        'use_fee',
        'subsidiary_fee',
    ];

    public function approval_list()
    {
        return $this->hasOne(ApprovalList::class, 'grid_id', 'grid_id')->latest();
    }

    public function grid()
    {
        return $this->hasOne(Grid::class, 'id', 'grid_id');
    }

}
